var left = document.querySelector('.top .left')
var right = document.querySelector('.top .right')
        
left.onclick=()=>{
    console.log('left', userKhd, userIp, userNetwork)
    Alert(1)
}
right.onclick=()=>{
    console.log('right', userShebei)
    Alert(2)
}
var Alert =(i)=>{
    var zhezhao = document.createElement('div')
    
    zhezhao.style.position='fixed'
    zhezhao.style.width='100%'
    zhezhao.style.height='100%'
    zhezhao.style.backgroundColor='#00000061'
    zhezhao.style.display='flex'
    zhezhao.style.justifyContent='center'
    zhezhao.style.alignItems='center'
    zhezhao.onclick=function(){
        zhezhao.style.display='none'
    }

    var box = document.createElement('div')
    box.style.width='75%'
    box.style.boxSizing='border-box'
    box.style.padding='.7246rem .4831rem'
    box.style.backgroundColor='#fff'
    box.style.borderRadius='.2415rem'
    box.style.fontSize='.4348rem'
    box.style.lineHeight='.80rem'
    box.className='Alert'
    if(i == 1){
        //var boxHTML = `<p><span>ip</span>：${userIp}</p><p><span style='display: inline-block;text-align: right;width:2.4155rem;font-weight:600;margin-right:.4348rem;border:1px solid red;'>我的位置</span>${userKhd}</p><p>&emsp;网络类型：${userNetwork}</p>`
        var boxHTML = `<p><span>ip</span>${userIp}</p><p><span style='width:1.9566rem' class='lang'>我的位置</span>${userKhd}</p><p><span>网络类型</span>${userNetwork}</p><p><span>服务区</span>${userFwq}</p>`
    }else if(i == 2){
        var myShebei = userShebei.split('  ')[0]
        var myOs = userShebei.split('  ')[1]
        var boxHTML = `<p><span style='width:1.9566rem' class='lang'>我的设备</span>${myShebei}</p><p><span>系统</span>${myOs}</p>`
    }

    box.innerHTML=boxHTML
    var W = box.querySelector(".lang").style.width
    console.log(2,W)
    var spans = box.querySelectorAll(".Alert p span")
    for(var i=0;i<spans.length;i++){
        spans[i].style.width=W
        console.log('1')
    }
    
    
    /*
    box.style.=''
    box.style.=''
    box.style.=''
    box.style.=''
    box.style.=''
    box.style.=''
    box.style.=''
    box.style.=''
    box.style.=''*/


    zhezhao.appendChild(box)
    document.body.appendChild(zhezhao)

}
